package com.itheima.InClass;

public class Student {
    private String name;
    private int age;

    public void setAge(int age) {//设置设定方法
        if (age > 0 && age <= 120) {
            this.age = age;
        } else {
            System.out.println("输入有误");
        }
    }

    public int getAge() {
        return this.age;//设定获取方法
    }

    public void setName(String name) {
        this.name = name;


    }

    public String getName() {
        return this.name;
    }

    public void show() {
        System.out.println(name + "..." + age);
    }
}